#include "cSprite.h"

cSprite::cSprite() 
{
	//Initialize the information of the Sprite class
	m_bIsVisible = false;

	//
	m_pTexture = NULL;

	//
	D3DXMatrixIdentity(&m_translation);
	D3DXMatrixIdentity(&m_rotation);
	D3DXMatrixIdentity(&m_scale);
}

cSprite::cSprite(char *fileName)
{
	//Initialize the information of the Sprite class
	//Is the sprite currently visible
	m_bIsVisible = true;

	//Get the texture resource
	m_pTexture = new cTexture(fileName);

	//Use the Identity Matrix to 0 out the uninitialized matrices
	D3DXMatrixIdentity(&m_translation);
	D3DXMatrixIdentity(&m_rotation);
	D3DXMatrixIdentity(&m_scale);
}

cSprite::~cSprite()
{
	m_bIsVisible = false;

	//
	delete m_pTexture;
}

cTexture *cSprite::getTexture()
{
	//
	return m_pTexture;
}

void cSprite::setVisibility(bool bIsVisible)
{
	//
	m_bIsVisible = bIsVisible;
}

bool cSprite::getVisibility()
{
	//
	return m_bIsVisible;
}

void cSprite::setTranslation(D3DXMATRIX transMat)
{
	//
	m_translation = transMat;
}

D3DXMATRIX cSprite::getTranslation()
{
	//
	return m_translation;
}

void cSprite::setRotation(D3DXMATRIX rotMat)
{
	//
	m_rotation = rotMat;
}

D3DXMATRIX cSprite::getRotation()
{
	//
	return m_rotation;
}

void cSprite::setScale(D3DXMATRIX scaleMat)
{
	//
	m_scale = scaleMat;
}

D3DXMATRIX cSprite::getScale()
{
	//
	return m_scale;
}